package tw.com.softleader.reins.demo.movie.app;

import tw.com.softleader.reins.demo.movie.entity.Movie;
import tw.com.softleader.reins.demo.movie.service.MovieService;

//Complete
public class MovieApp {
	
	public static void main(String[] args) {
		System.out.printf("%-8s%-15s%-15s%-28s%-15s%n", 
				"[ID]", "[Name]", "[Director]", "[Length]", "[Type]");
		MovieService movieService = new MovieService();
		
		for (Movie movie:movieService.getAll()) {
			System.out.printf(" %-7s%-15s%-15s%-28s%-15s%n", 
					movie.getId(), movie.getName(), movie.getDirector(), movie.getLength(), movie.getType());
		}
		
		System.out.println();
		
		Movie movie = movieService.getById(1L);
		System.out.printf(" %-7s%-15s%-15s%-28s%-15s%n", 
				movie.getId(), movie.getName(), movie.getDirector(), movie.getLength(), movie.getType());
		
	}

}
